package com.haixiaoke.service.impl;

import java.util.List;
import com.haixiaoke.common.utils.DateUtils;
import com.haixiaoke.mapper.LockWarningLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haixiaoke.domain.LockWarningLog;
import com.haixiaoke.service.ILockWarningLogService;

/**
 * 智能锁告警日志Service业务层处理
 *
 * @author qixi
 * @date 2023-05-27
 */
@Service
public class LockWarningLogServiceImpl implements ILockWarningLogService {
    @Autowired
    private LockWarningLogMapper lockWarningLogMapper;

    /**
     * 查询智能锁告警日志
     *
     * @param warningLogId 智能锁告警日志主键
     * @return 智能锁告警日志
     */
    @Override
    public LockWarningLog selectLockWarningLogByWarningLogId(Long warningLogId) {
        return lockWarningLogMapper.selectLockWarningLogByWarningLogId(warningLogId);
    }

    /**
     * 查询智能锁告警日志列表
     *
     * @param lockWarningLog 智能锁告警日志
     * @return 智能锁告警日志
     */
    @Override
    public List<LockWarningLog> selectLockWarningLogList(LockWarningLog lockWarningLog) {
        return lockWarningLogMapper.selectLockWarningLogList(lockWarningLog);
    }

    /**
     * 新增智能锁告警日志
     *
     * @param lockWarningLog 智能锁告警日志
     * @return 结果
     */
    @Override
    public int insertLockWarningLog(LockWarningLog lockWarningLog) {
        lockWarningLog.setCreateTime(DateUtils.getNowDate());
        return lockWarningLogMapper.insertLockWarningLog(lockWarningLog);
    }

    /**
     * 修改智能锁告警日志
     *
     * @param lockWarningLog 智能锁告警日志
     * @return 结果
     */
    @Override
    public int updateLockWarningLog(LockWarningLog lockWarningLog) {
        return lockWarningLogMapper.updateLockWarningLog(lockWarningLog);
    }

    /**
     * 批量删除智能锁告警日志
     *
     * @param warningLogIds 需要删除的智能锁告警日志主键
     * @return 结果
     */
    @Override
    public int deleteLockWarningLogByWarningLogIds(Long[] warningLogIds) {
        return lockWarningLogMapper.deleteLockWarningLogByWarningLogIds(warningLogIds);
    }

    /**
     * 删除智能锁告警日志信息
     *
     * @param warningLogId 智能锁告警日志主键
     * @return 结果
     */
    @Override
    public int deleteLockWarningLogByWarningLogId(Long warningLogId) {
        return lockWarningLogMapper.deleteLockWarningLogByWarningLogId(warningLogId);
    }
}
